﻿using _2._23._2015_GroceryList.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace _2._23._2015_GroceryList.Controllers
{
    public class apiGroceryItemTypesController : ApiController
    {
        public IHttpActionResult Get()
        {
            GroceryListDbContext db = new GroceryListDbContext();

            return Ok(db.GroceryItemTypes.Select(g => new {
                Name = g.Name,
                Value = g.GroceryItemTypeId
            }));
        }
    }
}
